<template>

	<view>
		<view class="p3 f28">
			<mpHtml v-if="isshow==true" :content="find.content"></mpHtml>
		</view>

		<view class="flex j-c a-c" style="width: 750rpx;height: 60vh;" v-if="isshow==false">
			<view class="">
				<image src="../static/lo.gif" style="width: 60rpx;height: 60rpx;"></image>
			</view>
		</view>
	</view>
</template>

<script>
	import $H from '../common/free-lib/request.js';
	// import uParse from '@/page1/components/u-parse/u-parse.vue'
	import mpHtml from '@/page1/components/mp-html/mp-html.vue'
	export default {
		components: {
			// uParse,
			mpHtml
		},
		data() {
			return {
				find: {},
				id: 0,
				isshow: false
			}
		},
		onLoad(options) {
			this.id = parseInt(options.id);
			this.init();

		},
		methods: {
			preview(src, e) {
				console.log("src: " + JSON.stringify(src));
				// do something
			},
			navigate(href, e) {
				// do something
			},
			init() {
				let that = this
				const user_id = uni.getStorageSync('user_id');
				const token = uni.getStorageSync('token');
				let requestParams = {
					user_id: user_id,
					token: token,
					id: this.id
				};
				$H.post('banmi.php/Article/article_view', 'app', {
					token: false,
					datalist: requestParams
				}).then(ret => {
					this.url = ret.data.img_url;
					this.find = ret.data.data.find;
					setTimeout(function() {
						that.isshow = true;
					}, 500);
					uni.setNavigationBarTitle({
						title: this.find.name
					})
				})

			},
		}
	}
</script>

<style>
	page {
		background-color: #fff;
	}

	img {
		max-width: 100%;
		height: auto;
	}
</style>